home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Folders.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  13.0 KB  |  370 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Folders.a
  3. ;
  4. ;    Contains:    Folder Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__FOLDERS__') = 'UNDEFINED' THEN
  18. __FOLDERS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.  
  24.  
  25. kOnSystemDisk                    EQU        -32768                ; previously was 0x8000 but that is an unsigned value whereas vRefNum is signed
  26.  
  27. kCreateFolder                    EQU        1
  28. kDontCreateFolder                EQU        0
  29.  
  30. kSystemFolderType                EQU        'macs'                ; the system folder 
  31. kDesktopFolderType                EQU        'desk'                ; the desktop folder; objects in this folder show on the desk top. 
  32. kTrashFolderType                EQU        'trsh'                ; the trash folder; objects in this folder show up in the trash 
  33. kWhereToEmptyTrashFolderType    EQU        'empt'                ; the "empty trash" folder; Finder starts empty from here down 
  34. kPrintMonitorDocsFolderType        EQU        'prnt'                ; Print Monitor documents 
  35. kStartupFolderType                EQU        'strt'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here 
  36. kShutdownFolderType                EQU        'shdf'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here 
  37. kAppleMenuFolderType            EQU        'amnu'                ; Finder objects to put into the Apple menu go here 
  38. kControlPanelFolderType            EQU        'ctrl'                ; Control Panels go here (may contain INITs) 
  39. kExtensionFolderType            EQU        'extn'                ; System extensions go here 
  40. kFontsFolderType                EQU        'font'                ; Fonts go here 
  41. kPreferencesFolderType            EQU        'pref'                ; preferences for applications go here 
  42. kTemporaryFolderType            EQU        'temp'                ; temporary files go here (deleted periodically, but don't rely on it.) 
  43. ;    Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  44. ;            while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  45. ;            Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  46. ;
  47.  
  48.     IF &TYPE('USE_FINDFOLDER_GLUE') <> 'UNDEFINED' THEN
  49. ;
  50. ; pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  51. ;
  52.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  53.         IMPORT_CFM_FUNCTION FindFolder
  54.     ENDIF
  55.  
  56.     ELSE
  57. ;
  58. ; pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  59. ;
  60.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  61.         Macro
  62.         _FindFolder
  63.             moveq               #0,D0
  64.             dc.w                $A823
  65.         EndM
  66.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  67.         IMPORT_CFM_FUNCTION FindFolder
  68.     ENDIF
  69.  
  70.     ENDIF
  71. ;
  72. ; pascal OSErr ReleaseFolder(short vRefNum, OSType folderType)
  73. ;
  74.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  75.         Macro
  76.         _ReleaseFolder
  77.             moveq               #11,D0
  78.             dc.w                $A823
  79.         EndM
  80.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  81.         IMPORT_CFM_FUNCTION ReleaseFolder
  82.     ENDIF
  83.  
  84.  
  85.     IF ¬ TARGET_OS_MAC THEN
  86. ;  Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  87. ;   the found folder path.
  88.  
  89. ;
  90. ; extern OSErr FindFolderEx(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID, char *foundFolder)
  91. ;
  92.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  93.         IMPORT_CFM_FUNCTION FindFolderEx
  94.     ENDIF
  95.  
  96.     ENDIF
  97. ; *****************************************
  98. ;  Extensible Folder Manager declarations 
  99. ; *****************************************
  100.  
  101. ; ***************************
  102. ;  Folder Manager constants 
  103. ; ***************************
  104.  
  105.  
  106. kExtensionDisabledFolderType    EQU        'extD'
  107. kControlPanelDisabledFolderType    EQU        'ctrD'
  108. kSystemExtensionDisabledFolderType EQU    'macD'
  109. kStartupItemsDisabledFolderType    EQU        'strD'
  110. kShutdownItemsDisabledFolderType EQU    'shdD'
  111. kApplicationsFolderType            EQU        'apps'
  112. kDocumentsFolderType            EQU        'docs'
  113.  
  114.                                                             ; new constants 
  115. kVolumeRootFolderType            EQU        'root'                ; root folder of a volume 
  116. kChewableItemsFolderType        EQU        'flnt'                ; items deleted at boot 
  117. kApplicationSupportFolderType    EQU        'asup'                ; third-party items and folders 
  118. kTextEncodingsFolderType        EQU        'ƒtex'                ; encoding tables 
  119. kStationeryFolderType            EQU        'odst'                ; stationery 
  120. kOpenDocFolderType                EQU        'odod'                ; OpenDoc root 
  121. kOpenDocShellPlugInsFolderType    EQU        'odsp'                ; OpenDoc Shell Plug-Ins in OpenDoc folder 
  122. kEditorsFolderType                EQU        'oded'                ; OpenDoc editors in MacOS Folder 
  123. kOpenDocEditorsFolderType        EQU        'ƒodf'                ; OpenDoc subfolder of Editors folder 
  124. kOpenDocLibrariesFolderType        EQU        'odlb'                ; OpenDoc libraries folder 
  125. kGenEditorsFolderType            EQU        'ƒedi'                ; CKH general editors folder at root level of Sys folder 
  126. kHelpFolderType                    EQU        'ƒhlp'                ; CKH help folder currently at root of system folder 
  127. kInternetPlugInFolderType        EQU        'ƒnet'                ; CKH internet plug ins for browsers and stuff 
  128. kModemScriptsFolderType            EQU        'ƒmod'                ; CKH modem scripts, get 'em OUT of the Extensions folder 
  129. kPrinterDescriptionFolderType    EQU        'ppdf'                ; CKH new folder at root of System folder for printer descs. 
  130. kPrinterDriverFolderType        EQU        'ƒprd'                ; CKH new folder at root of System folder for printer drivers 
  131. kScriptingAdditionsFolderType    EQU        'ƒscr'                ; CKH at root of system folder 
  132. kSharedLibrariesFolderType        EQU        'ƒlib'                ; CKH for general shared libs. 
  133. kVoicesFolderType                EQU        'fvoc'                ; CKH macintalk can live here 
  134. kControlStripModulesFolderType    EQU        'sdev'                ; CKH for control strip modules 
  135. kAssistantsFolderType            EQU        'astƒ'                ; SJF for Assistants (MacOS Setup Assistant, etc) 
  136. kUtilitiesFolderType            EQU        'utiƒ'                ; SJF for Utilities folder 
  137. kAppleExtrasFolderType            EQU        'aexƒ'                ; SJF for Apple Extras folder 
  138. kContextualMenuItemsFolderType    EQU        'cmnu'                ; SJF for Contextual Menu items 
  139. kMacOSReadMesFolderType            EQU        'morƒ'                ; SJF for MacOS ReadMes folder 
  140. kALMModulesFolderType            EQU        'walk'                ; EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) 
  141. kALMPreferencesFolderType        EQU        'trip'                ; EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) 
  142. kALMLocationsFolderType            EQU        'fall'                ; EAS for Location Manager Locations (within kALMPreferencesFolderType) 
  143. kColorSyncProfilesFolderType    EQU        'prof'                ; for ColorSync™ Profiles 
  144. kThemesFolderType                EQU        'thme'                ; for Theme data files 
  145. kFavoritesFolderType            EQU        'favs'                ; Favorties folder for Navigation Services 
  146. kInternetFolderType                EQU        'intƒ'                ; Internet folder (root level of startup volume) 
  147. kAppearanceFolderType            EQU        'appr'                ; Appearance folder (root of system folder) 
  148. kSoundSetsFolderType            EQU        'snds'                ; Sound Sets folder (in Appearance folder) 
  149. kDesktopPicturesFolderType        EQU        'dtpƒ'                ; Desktop Pictures folder (in Appearance folder) 
  150. kInternetSearchSitesFolderType    EQU        'issf'                ; Internet Search Sites folder 
  151. kFindSupportFolderType            EQU        'fnds'                ; Find support folder 
  152. kFindByContentFolderType        EQU        'fbcf'                ; Find by content folder 
  153. kInstallerLogsFolderType        EQU        'ilgf'                ; Installer Logs folder 
  154. kScriptsFolderType                EQU        'scrƒ'                ; Scripts folder 
  155. kFolderActionsFolderType        EQU        'fasf'                ; Folder Actions Scripts folder 
  156. kLauncherItemsFolderType        EQU        'laun'                ; Launcher Items folder 
  157. kRecentApplicationsFolderType    EQU        'rapp'                ; Recent Applications folder 
  158. kRecentDocumentsFolderType        EQU        'rdoc'                ; Recent Documents folder 
  159. kRecentServersFolderType        EQU        'rsvr'                ; Recent Servers folder 
  160. kSpeakableItemsFolderType        EQU        'spki'                ; Speakable Items folder 
  161.  
  162. ;  FolderDescFlags values 
  163.  
  164. kCreateFolderAtBoot                EQU        $00000002
  165. kFolderCreatedInvisible            EQU        $00000004
  166. kFolderCreatedNameLocked        EQU        $00000008
  167. ; typedef UInt32                         FolderDescFlags
  168.  
  169. ;  FolderClass values 
  170.  
  171. kRelativeFolder                    EQU        'relf'
  172. kSpecialFolder                    EQU        'spcf'
  173. ; typedef OSType                         FolderClass
  174.  
  175. ;  special folder locations 
  176.  
  177. kBlessedFolder                    EQU        'blsf'
  178. kRootFolder                        EQU        'rotf'
  179. ; typedef OSType                         FolderType
  180.  
  181. ; typedef OSType                         FolderLocation
  182.  
  183.  
  184. FolderDesc                RECORD 0
  185. descSize                 ds.l    1                ; offset: $0 (0)
  186. foldType                 ds.l    1                ; offset: $4 (4)
  187. flags                     ds.l    1                ; offset: $8 (8)
  188. foldClass                 ds.l    1                ; offset: $C (12)
  189. foldLocation             ds.l    1                ; offset: $10 (16)
  190. badgeSignature             ds.l    1                ; offset: $14 (20)
  191. badgeType                 ds.l    1                ; offset: $18 (24)
  192. reserved                 ds.l    1                ; offset: $1C (28)
  193. name                     ds        StrFileName        ; offset: $20 (32)        ;  Str63 on MacOS
  194. sizeof                     EQU *                    ; size:   $60 (96)
  195.                         ENDR
  196. ; typedef struct FolderDesc *            FolderDescPtr
  197.  
  198.  
  199. ; typedef UInt32                         RoutingFlags
  200.  
  201. FolderRouting            RECORD 0
  202. descSize                 ds.l    1                ; offset: $0 (0)
  203. fileType                 ds.l    1                ; offset: $4 (4)
  204. routeFromFolder             ds.l    1                ; offset: $8 (8)
  205. routeToFolder             ds.l    1                ; offset: $C (12)
  206. flags                     ds.l    1                ; offset: $10 (16)
  207. sizeof                     EQU *                    ; size:   $14 (20)
  208.                         ENDR
  209. ; typedef struct FolderRouting *        FolderRoutingPtr
  210.  
  211. ;  routing constants 
  212. ; **************************
  213. ;  Folder Manager routines 
  214. ; **************************
  215. ;  Folder Manager administration routines 
  216. ;
  217. ; pascal OSErr AddFolderDescriptor(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, ConstStrFileNameParam name, Boolean replaceFlag)
  218. ;
  219.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  220.         Macro
  221.         _AddFolderDescriptor
  222.             moveq               #32,D0
  223.             dc.w                $A823
  224.         EndM
  225.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  226.         IMPORT_CFM_FUNCTION AddFolderDescriptor
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal OSErr GetFolderDescriptor(FolderType foldType, Size descSize, FolderDesc *foldDesc)
  231. ;
  232.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  233.         Macro
  234.         _GetFolderDescriptor
  235.             moveq               #35,D0
  236.             dc.w                $A823
  237.         EndM
  238.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  239.         IMPORT_CFM_FUNCTION GetFolderDescriptor
  240.     ENDIF
  241.  
  242. ;
  243. ; pascal OSErr GetFolderTypes(UInt32 requestedTypeCount, UInt32 *totalTypeCount, FolderType *theTypes)
  244. ;
  245.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  246.         Macro
  247.         _GetFolderTypes
  248.             moveq               #36,D0
  249.             dc.w                $A823
  250.         EndM
  251.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  252.         IMPORT_CFM_FUNCTION GetFolderTypes
  253.     ENDIF
  254.  
  255. ;
  256. ; pascal OSErr RemoveFolderDescriptor(FolderType foldType)
  257. ;
  258.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  259.         Macro
  260.         _RemoveFolderDescriptor
  261.             moveq               #33,D0
  262.             dc.w                $A823
  263.         EndM
  264.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  265.         IMPORT_CFM_FUNCTION RemoveFolderDescriptor
  266.     ENDIF
  267.  
  268. ;  legacy routines 
  269. ;
  270. ; pascal OSErr GetFolderName(short vRefNum, OSType foldType, short *foundVRefNum, StrFileName name)
  271. ;
  272.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  273.         Macro
  274.         _GetFolderName
  275.             moveq               #14,D0
  276.             dc.w                $A823
  277.         EndM
  278.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  279.         IMPORT_CFM_FUNCTION GetFolderName
  280.     ENDIF
  281.  
  282. ;  routing routines 
  283. ;
  284. ; pascal OSErr AddFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag)
  285. ;
  286.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  287.         Macro
  288.         _AddFolderRouting
  289.             moveq               #38,D0
  290.             dc.w                $A823
  291.         EndM
  292.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  293.         IMPORT_CFM_FUNCTION AddFolderRouting
  294.     ENDIF
  295.  
  296. ;
  297. ; pascal OSErr RemoveFolderRouting(OSType fileType, FolderType routeFromFolder)
  298. ;
  299.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  300.         Macro
  301.         _RemoveFolderRouting
  302.             moveq               #39,D0
  303.             dc.w                $A823
  304.         EndM
  305.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  306.         IMPORT_CFM_FUNCTION RemoveFolderRouting
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal OSErr FindFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType *routeToFolder, RoutingFlags *flags)
  311. ;
  312.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  313.         Macro
  314.         _FindFolderRouting
  315.             moveq               #34,D0
  316.             dc.w                $A823
  317.         EndM
  318.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  319.         IMPORT_CFM_FUNCTION FindFolderRouting
  320.     ENDIF
  321.  
  322. ;
  323. ; pascal OSErr GetFolderRoutings(UInt32 requestedRoutingCount, UInt32 *totalRoutingCount, Size routingSize, FolderRouting *theRoutings)
  324. ;
  325.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  326.         Macro
  327.         _GetFolderRoutings
  328.             moveq               #30,D0
  329.             dc.w                $A823
  330.         EndM
  331.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  332.         IMPORT_CFM_FUNCTION GetFolderRoutings
  333.     ENDIF
  334.  
  335. ;
  336. ; pascal OSErr InvalidateFolderDescriptorCache(short vRefNum, long dirID)
  337. ;
  338.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  339.         Macro
  340.         _InvalidateFolderDescriptorCache
  341.             moveq               #37,D0
  342.             dc.w                $A823
  343.         EndM
  344.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  345.         IMPORT_CFM_FUNCTION InvalidateFolderDescriptorCache
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal OSErr IdentifyFolder(short vRefNum, long dirID, FolderType *foldType)
  350. ;
  351.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  352.         Macro
  353.         _IdentifyFolder
  354.             moveq               #31,D0
  355.             dc.w                $A823
  356.         EndM
  357.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  358.         IMPORT_CFM_FUNCTION IdentifyFolder
  359.     ENDIF
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.     ENDIF ; __FOLDERS__ 
  367.  
  368.